Skip to content

Conversation

pedroCabrera
Copy link

Hi there, i have modified the ESRGAN code to support more models, i tested with a bunch from https://openmodeldb.info/ and some work out of the box but some of them had to be converted with :

import torch
checkpoint = torch.load(r"model.pth",map_location="cpu")
torch.save(checkpoint,r"model_converted.pth",_use_new_zipfile_serialization=True)

I have also tested with x2 and x1 models from that web and some of them works ( 2x-ESRGAN.pth , 1x-Anti-Aliasing.pth )
It also supports RealESRGAN_x4plus.pth as well as the original RealESRGAN_x4plus_anime_6B.pth

PD: I'm integrating stable-diffusion.cpp into Nuke wich is a vfx software , my repo is here -> pc_nuke_diffusion, still early development but most of the cli options are avaliable there already.

esrgan_test

@fszontagh
Copy link
Contributor

fszontagh commented Sep 24, 2025

A simple python script to convert an old type .pth:
convert_pth.py old_format.pth new_format_pth.pth
https://gist.github.com/fszontagh/4b1765d3ec75e1200f7a17ad8969da8b

Original image (512x768)
0ad0e5d9-7853-49d8-a5d9-3a00d333ef85_resized_512x768_refined_upscale_test_current_sd_normal

Upscaled image with the converted 4x_Nickelback_70000G.pth (2048x3072)

0ad0e5d9-7853-49d8-a5d9-3a00d333ef85_resized_512x768_refined_upscale_test

This is upscaled with RealESRGAN_x4plus.pth (which is worked earlier ) (2048x3072)
0ad0e5d9-7853-49d8-a5d9-3a00d333ef85_resized_512x768_refined

@wbruna
Copy link
Contributor

wbruna commented Sep 29, 2025

#865 can be used to test the upscaler models with external images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants